﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Vortex.Drawing {

	/// <summary>
	/// Description of geometry fragment
	/// </summary>
	class VertexFragment {
		public int VertexCount;
		public int IndexCount;
		public PrimitiveType PrimitiveType;

		public VertexFragment(int vertexCount, int indexCount, PrimitiveType primitiveType) {
			VertexCount = vertexCount;
			IndexCount = indexCount;
			PrimitiveType = primitiveType;
		}

		public static readonly VertexFragment Line = new VertexFragment(2, 2, PrimitiveType.LineList);
		public static readonly VertexFragment Rect = new VertexFragment(4, 8, PrimitiveType.LineList);
		public static readonly VertexFragment StyledRect = new VertexFragment(2 * (4 + 1), 3 * 4 * 2, PrimitiveType.TriangleList);
		public static readonly VertexFragment Triangle = new VertexFragment(3, 3, PrimitiveType.TriangleList);
		public static readonly VertexFragment Quad = new VertexFragment(4, 6, PrimitiveType.TriangleList);
	}

	/// <summary>
	/// Location of geometry fragment in device buffers
	/// </summary>
	unsafe struct FragmentLocation {
		public Vertex2D* Vertices;
		public ushort* Indices;
		public ushort BaseIndex;
	}

}
